from django.db import models
import random
# 这个default函数主要是为了说明 参数不一定全是确定值，完全可以是函数
def default_sign():
    signs = ['IT精英','网购达人','大富翁','热心市民']
    return random.choice(signs)
# Create your models here.
class UserProfile(models.Model):
    username = models.CharField('姓名',max_length=50,unique=True)
    nickname = models.CharField('昵称',max_length=50)
    email = models.EmailField()
    password = models.CharField(max_length=32)
    sign = models.CharField('个人签名',max_length=50,default=default_sign())
    #info = models.CharField('个人描述',max_length=150)
    avatar = models.ImageField(upload_to='avatar',null=True)
    created_time = models.DateTimeField(auto_now_add=True)
    updated_time = models.DateTimeField(auto_now_add=True)
    phone = models.CharField(max_length=11,default='')
    birthday = models.CharField('生日',max_length=10,null=True)
class Address(models.Model):
    pass